import { get, post, fileDownload } from "../utils/request"

// 单位机构管理 - 列表
export const loadOrgList = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrg/pageQuery`, params);

// 单位机构管理 - 新增
export const addOrg = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrg/insert`, params);

// 单位机构管理 - 编辑
export const updateOrg = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrg/update`, params);

// 单位机构管理 - 删除
export const deleteOrg = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrg/delete?id=${id}`, null);

// 单位机构管理 - 树形结构
export const loadOrgTree = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrg/tree`, params);

// 单位机构管理 - 主键查询
export const loadOrgById = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrg/selectById?id=${id}`, null);


// 福利人员管理 - 列表
export const loadWelfareUserList = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUser/pageQuery`, params);

// 福利人员管理 - 新增
export const addWelfareUser = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUser/insert`, params);

// 福利人员管理 - 编辑
export const updateWelfareUser = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUser/update`, params);

// 福利人员管理 - 删除
export const deleteWelfareUser = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUser/delete?id=${id}`, null);

// 福利人员管理 - 查询详情
export const loadWelfareUserById = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUser/selectById?id=${id}`, null);

// 福利人员管理 - Excel导入单位人员
export const importWelfareUser = (orgId: string, params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUser/importByExcel?orgId=${orgId}`, params);

// 福利人员管理 - 下载Excel导入模板
export const getExcelWelfareUserTmpl = (fileName: string)=> fileDownload("/cdwl-weal-grant-service/sysBaseOrgUser/getExcelTmpl",null, fileName)


// 单位分组管理 - 列表
export const loadUserGroup = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUserGroup/pageQuery`, params);

// 单位分组管理 - 新增
export const addUserGroup = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUserGroup/insert`, params);

// 单位分组管理 - 编辑
export const updateUserGroup = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUserGroup/update`, params);

// 单位分组管理 - 删除
export const deleteUserGroup = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgUserGroup/delete?id=${id}`, null);

// 人员分组管理 - 列表
export const loadGroupUser = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgGroupUser/pageQuery`, params);

// 人员分组管理 - 新增
export const addGroupUser = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgGroupUser/batchInsert`, params);

// 人员分组管理 - 删除
export const deleteGroupUser = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/sysBaseOrgGroupUser/delete?id=${id}`, null);


// 福利发放列表
export const loadWealGrantList = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/pageQuery`, params);

// 福利发放 - 编辑
export const editGrant = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/update`, params);

// 选择发放 - 新增
export const saveGrantBySelect = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/grantBySelect`, params);

// 选择发放 - 编辑 - 查询选中的人员信息
export const queryChosenPerson = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWealDetail/queryChosenPerson?grantWealId=${params.grantWealId}`, params);

// 分组发放 - 新增
export const saveGrantByGroup = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/grantByGroup`, params);

// 福利发放 - 提交审核
export const saveSubmitAudit = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/submitAudit?id=${id}`, null);

// 福利发放 - 审核
export const saveAudit = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/audit`, params);

// 福利发放 - 确认发放
export const saveConfirmGrant = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/confirmGrant?id=${id}`, null);

// 福利发放 - 删除
export const deleteGrantWeal = (id: string): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/delete?id=${id}`, null);

// 福利发放 - Excel发放 - 导入模板下载
export const getExcelWelfareGrantTmpl = (fileName: string)=> fileDownload("/cdwl-weal-grant-service//grantWeal/getExcelTmpl",null, fileName);

// 福利发放 - Excel发放 - 新增
export const saveGrantByExcel = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWeal/grantByExcel`, params);

// 福利发放 - 福利发方明细
export const loadGrantWealDetailList = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWealDetail/pageQuery`, params);

// 福利发放 - 福利发方法 - 操作明细
export const loadGrantWealOperateLog = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWealOperateLog/pageQuery`, params);

// 福利发放 - 福利发方批次
export const loadGrantWealBatchList = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWealBatch/pageQuery`, params);

// 福利发放 - 福利发方批次 - 详情
export const loadGrantWealBatchDetailList = (params: any): Promise<any> => post(`/cdwl-weal-grant-service/grantWealBatchDetail/pageQuery`, params);